package com.wjk.kylin.mall.order.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.wjk.kylin.mall.order.entity.OrderEntity;
import org.apache.ibatis.annotations.*;
import org.apache.ibatis.mapping.ResultSetType;
import org.apache.ibatis.session.ResultHandler;

/**
 * 订单
 */
@Mapper
public interface OrderMapper extends BaseMapper<OrderEntity> {
    /**
     * 流式查询 有查询条件
     *
     * @param parameter
     * @param handler
     */
    void streamDataDynamicHandle(OrderEntity parameter, ResultHandler<OrderEntity> handler);

    /**
     * 流式查询 无查询条件
     *
     * @param handler
     */
    void streamDataDynamicHandle(ResultHandler<OrderEntity> handler);

    /**
     * @param wrapper
     * @param handler
     */
    @Select("select * from t_order t ${ew.customSqlSegment}")
    @Options(resultSetType = ResultSetType.FORWARD_ONLY, fetchSize = Integer.MIN_VALUE)
    @ResultType(OrderEntity.class)
    void streamDataDynamicHandleForAnnotation(@Param(Constants.WRAPPER) QueryWrapper<OrderEntity> wrapper, ResultHandler<OrderEntity> handler);
}
